/**
 * Copyright(c) 2010 Ceno Techonologies Co., Ltd.
 *
 * History:
 *   15-6-17 下午12:47 Created by lyyang
 */
package com.xunton.bss.weixin.api.bonus.request;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * 发红包
 *
 * @author <a href="mailto:lyyang@ceno.cn">lyyang</a>
 * @version 1.0 15-6-17 下午12:47
 */
@XmlRootElement (name = "xml")
@XmlAccessorType (XmlAccessType.FIELD)
public class DeliverBonusRequest extends Request
{
    @XmlElement (name = "nonce_str")
    private String nonceStr;


    @XmlElement (name = "mch_billno")
    private String mchBillNo;

    @XmlElement (name = "mch_id")
    private String mchId;

    @XmlElement (name = "sub_mch_id")
    private String subMchId;

    @XmlElement (name = "wxappid")
    private String wxAppId;

    @XmlElement (name = "nick_name")
    private String nickName;

    @XmlElement (name = "send_name")
    private String sendName;

    @XmlElement (name = "re_openid")
    private String reOpenId;

    @XmlElement (name = "total_amount")
    private long totalAmount;

    @XmlElement (name = "min_value")
    private long minValue;

    @XmlElement (name = "max_value")
    private long maxValue;

    @XmlElement (name = "total_num")
    private int totalNum = 1;

    private String wishing;

    @XmlElement (name = "client_ip")
    private String clientIp;

    @XmlElement (name = "act_name")
    private String actName;

    private String remark;

    @XmlElement (name = "logo_imgurl")
    private String logoUrl;

    @XmlElement (name = "share_content")
    private String shareContent;

    @XmlElement (name = "share_url")
    private String shareUrl;

    @XmlElement (name = "share_imgurl")
    private String shareImgUrl;

    public DeliverBonusRequest(){
        nonceStr = UUID.randomUUID().toString().replace("-","");
        if (nonceStr.length()>32){
            nonceStr = nonceStr.substring(0,32);
        }
        params.put("nonce_str",nonceStr);
        params.put("total_num",1);
    }

    public String getNonceStr()
    {
        return nonceStr;
    }




    public String getMchBillNo()
    {
        return mchBillNo;
    }


    public String getMchId()
    {
        return mchId;
    }

    public void setMchId(String mchId)
    {
        this.mchId = mchId;
        params.put("mch_id",mchId);
        SimpleDateFormat sf = new SimpleDateFormat("yyyyMMdd0HHmmssSSS");
        mchBillNo = mchId+sf.format(new Date());
        params.put("mch_billno",mchBillNo);
    }

    public String getSubMchId()
    {
        return subMchId;
    }

    public void setSubMchId(String subMchId)
    {
        this.subMchId = subMchId;
        params.put("sub_mch_id",subMchId);
    }

    public String getWxAppId()
    {
        return wxAppId;
    }

    public void setWxAppId(String wxAppId)
    {
        params.put("wxappid",wxAppId);
        this.wxAppId = wxAppId;
    }

    public String getNickName()
    {
        return nickName;
    }

    public void setNickName(String nickName)
    {
        params.put("nick_name",nickName);
        this.nickName = nickName;
    }

    public String getSendName()
    {
        return sendName;
    }

    public void setSendName(String sendName)
    {
        params.put("send_name",sendName);
        this.sendName = sendName;
    }

    public String getReOpenId()
    {
        return reOpenId;
    }

    public void setReOpenId(String reOpenId)
    {
        params.put("re_openid",reOpenId);
        this.reOpenId = reOpenId;
    }

    public long getTotalAmount()
    {
        return totalAmount;
    }

    public void setTotalAmount(long totalAmount)
    {
        params.put("total_amount",totalAmount);
        this.totalAmount = totalAmount;
    }

    public long getMinValue()
    {
        return minValue;
    }

    public void setMinValue(long minValue)
    {
        params.put("min_value",minValue);
        this.minValue = minValue;
    }

    public long getMaxValue()
    {
        return maxValue;
    }

    public void setMaxValue(long maxValue)
    {
        params.put("max_value",maxValue);
        this.maxValue = maxValue;
    }

    public int getTotalNum()
    {
        return totalNum;
    }



    public String getWishing()
    {
        return wishing;
    }

    public void setWishing(String wishing)
    {
        params.put("wishing",wishing);
        this.wishing = wishing;
    }

    public String getClientIp()
    {

        return clientIp;
    }

    public void setClientIp(String clientIp)
    {
        params.put("client_ip",clientIp);
        this.clientIp = clientIp;
    }

    public String getActName()
    {
        return actName;
    }

    public void setActName(String actName)
    {
        params.put("act_name",actName);
        this.actName = actName;
    }

    public String getRemark()
    {
        return remark;
    }

    public void setRemark(String remark)
    {
        params.put("remark",remark);
        this.remark = remark;
    }

    public String getLogoUrl()
    {
        return logoUrl;
    }

    public void setLogoUrl(String logoUrl)
    {
        params.put("logo_imgurl",logoUrl);
        this.logoUrl = logoUrl;
    }

    public String getShareContent()
    {
        return shareContent;
    }

    public void setShareContent(String shareContent)
    {
        params.put("share_content",shareContent);
        this.shareContent = shareContent;
    }

    public String getShareUrl()
    {
        return shareUrl;
    }

    public void setShareUrl(String shareUrl)
    {
        params.put("share_url",shareUrl);
        this.shareUrl = shareUrl;
    }

    public String getShareImgUrl()
    {
        return shareImgUrl;
    }

    public void setShareImgUrl(String shareImgUrl)
    {
        params.put("share_imgurl",shareImgUrl);
        this.shareImgUrl = shareImgUrl;
    }
}
